local biaozhao = fk.CreateSkill{
    name = "heg__biaozhao",
}

Fk:loadTranslationTable{
    ["heg__biaozhao"] = "表召",
    [":heg__biaozhao"] = "出牌阶段限一次，你可以选择两名势力不同的其他角色，视为对其中一名角色使用一张【知己知彼】，"..
    "然后将一张牌交给另一名角色，若如此做，你摸一张牌。",

    ["#heg__biaozhao-invoke"] = "表召：选择两名势力不同的其他角色，视为对其中一名角色使用一张【知己知彼】，然后将一张牌交给另一名角色",
    ["heg_biaozhao_tip_1"] = "使用牌",
    ["heg_biaozhao_tip_2"] = "获得牌",

    ["$heg__biaozhao1"] = "孙策如秦末之项籍，如得时势，必有异志！",
    ["$heg__biaozhao2"] = "贡谨奉此表，以使君明孙策之异！",
}

local H = require "packages.ol_hegemony.util"

biaozhao:addEffect("active",{
    anim_type = "special",
    prompt = "#heg__biaozhao-invoke",
    can_use = function (self, player)
       return player:usedSkillTimes(biaozhao.name, Player.HistoryPhase) == 0
    end,
    card_num = 1,
    target_num = 2,
    card_filter = function(self, player, to_select, selected)
      return #selected == 0
    end,
    target_tip = function(self, _, to_select, selected, _, _, selectable, _)
      if not selectable then return end
      if #selected == 0 or (#selected > 0 and selected[1] == to_select) then
        return "heg_biaozhao_tip_1"
      else
        return "heg_biaozhao_tip_2"
      end
    end,
    target_filter = function(self, player, to_select, selected)
      if #selected < 2 and to_select ~= player then
        if #selected == 0 then
          return true
        else
          return to_select:canUseTo(Fk:cloneCard("known_both"), selected[1]) and not H.compareKingdomWith(to_select, selected[1])
        end
      end
    end,
    on_use = function (self, room, effect)
      local player = effect.from
      local to1 = effect.tos[1]
      local to2 = effect.tos[2]
      if to1.dead or to2.dead then return end
      room:obtainCard(to2, effect.cards[1], false, fk.ReasonPrey, player, biaozhao.name)
      room:useVirtualCard("known_both", nil, to1, to2, biaozhao.name, true)
      if player:isAlive() then
        player:drawCards(1, biaozhao.name)
      end
    end,
})

return biaozhao